Delete transients when activating cache#589
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to automatically delete all transients from the database when the Redis object cache is enabled. The change ensures that stale transients don't persist after cache activation by hooking into a new action that fires when cache enablement occurs.
- Introduces a new action hook
redis_object_cache_enablethat fires when cache is enabled via CLI - Adds a method to delete all transients from both options and sitemeta tables when cache activation succeeds
- Updates changelog to document the new transient deletion feature
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| includes/cli/class-commands.php | Adds the new redis_object_cache_enable action hook in the cache enable command |
| includes/class-plugin.php | Implements the transient deletion logic and hooks it to the new action |
| CHANGELOG.md | Documents the new transient deletion feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
yatsukhnenko
approved these changes
Oct 6, 2025
Update parameter name in maybe_delete_transients method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should avoid stale WooCommerce data.